#include "InetAddress.h"
#include "MyReactor.h"
#include "Acceptor.h"
#include "EchoServiceHandler.h"
#include "EventHandler.h"
#include <cstdio>
#include <string>
#include "Buffer.h"
#include "Thread.h"
#include "PatientService.h"
#include "PatientServiceHandler.h"

int main()
{
  InetAddress addr("localhost", "15000");
  Buffer * buf = new Buffer();
  Acceptor<PatientServiceHandler> accept(addr, MyReactor::instance(), buf); 
  Thread thr( &PatientService::run, (void *)buf);

  std::cout << "Server is ready! - listening for connections\n";
    
  for (;;)
    {
        MyReactor::instance()->handleEvents();
    }
}
